function [data_random] = glass_read(file_txt)
    % 读取Glass数据集文件
    data = dlmread(file_txt, ',');  % 使用逗号分隔符读取数值数据
    
    % 提取ID列和标签列
    id_col = data(:, 1);        % 第一列是ID
    labels = data(:, end);       % 最后一列是类别标签
    features = data(:, 2:end-1); % 中间9列是特征
    
    % 获取数据集信息
    num_samples = size(data, 1);
    num_features = size(features, 2);
    
    % 显示数据集统计信息
    fprintf('成功读取Glass数据集: %s\n', file_txt);
    fprintf('样本数量: %d\n', num_samples);
    fprintf('特征数量: %d\n', num_features);
    
    % 显示类别分布
    class_names = {
        '1: building_windows_float_processed', 
        '2: building_windows_non_float_processed', 
        '3: vehicle_windows_float_processed', 
        '4: vehicle_windows_non_float_processed (none)', 
        '5: containers', 
        '6: tableware', 
        '7: headlamps'
    };
    
    fprintf('\n类别分布:\n');
    for class_id = 1:7
        count = sum(labels == class_id);
        percent = count / num_samples * 100;
        
        if count > 0
            fprintf('  %-40s: %d (%.1f%%)\n', class_names{class_id}, count, percent);
        end
    end
    
    % 显示特征摘要统计
    fprintf('\n特征摘要统计:\n');
    feature_names = {
        'RI: refractive index', 
        'Na: Sodium', 
        'Mg: Magnesium', 
        'Al: Aluminum', 
        'Si: Silicon', 
        'K: Potassium', 
        'Ca: Calcium', 
        'Ba: Barium', 
        'Fe: Iron'
    };
    
    fprintf('%-20s %8s %8s %8s %8s\n', 'Feature', 'Min', 'Max', 'Mean', 'SD');
    for i = 1:num_features
        col = features(:, i);
        fprintf('%-20s %8.4f %8.4f %8.4f %8.4f\n', ...
                feature_names{i}, min(col), max(col), mean(col), std(col));
    end
    
    % 合并标签和特征（标签在第一列，去掉ID列）
    data_combined = [labels, features];
    
    % 随机打乱数据
    random_indices = randperm(size(data_combined, 1));
    data_random = data_combined(random_indices, :);
    
    % 显示打乱后的前几个样本的标签
    fprintf('\n数据已随机打乱，前5个样本的标签:\n');
    disp(data_random(1:5, 1)');
end